Below is shown a dump of the four matrices used to make the sequence alignment of two fasta files. You can use this to compare the output from you O3 and O2 programs. The output was made aligning two small sequences
VLPVLILP VLLPVLLP
If you run the O3 code with the parameters defined in the "Now test the code on a few examples" box for "Matrix dump exercise 2", you should get
ALN VLPVLILP 8 VLLPVLLP 8 9 7 41.0 QAL VL-PVLILP DAL VLLPVL-LP --- D Matrix [[41 39 36 30 20 16 13 7 0] [35 36 38 31 20 15 15 8 0] [29 30 31 33 21 15 10 10 0] [24 21 20 21 23 16 11 5 0] [18 19 20 16 18 18 12 6 0] [17 17 14 15 17 17 13 7 0] [12 13 15 11 12 13 15 8 0] [ 6 7 8 10 6 7 8 10 0] [ 0 0 0 0 0 0 0 0 0]] E Matrix [[1 1 2 3 1 1 2 3 0] [5 1 1 2 3 1 1 2 0] [5 5 4 1 2 3 3 1 0] [1 1 5 4 1 2 3 3 0] [1 1 1 4 1 1 1 3 0] [1 1 5 4 1 1 2 3 0] [5 1 1 5 5 1 1 2 0] [5 5 4 1 5 5 4 1 0] [0 0 0 0 0 0 0 0 0]]
Next you can do the same for the O2 program
ALN Query 8 Database 8 9 41.0 7 QAL VL-PVLILP DAL VLLPVL-LP --- D Matrix [[41 39 36 30 20 16 13 7 0] [35 36 38 31 20 15 15 8 0] [29 30 31 33 21 15 10 10 0] [24 21 20 21 23 16 11 5 0] [18 19 20 16 18 18 12 6 0] [17 17 14 15 17 17 13 7 0] [12 13 15 11 12 13 15 8 0] [ 6 7 8 10 6 7 8 10 0] [ 0 0 0 0 0 0 0 0 0]] E Matrix [[1 1 2 3 1 1 2 3 0] [5 1 1 2 3 1 1 2 0] [5 5 4 1 2 3 3 1 0] [1 1 5 4 1 2 3 3 0] [1 1 1 4 1 1 1 3 0] [1 1 5 4 1 1 2 3 0] [5 1 1 5 5 1 1 2 0] [5 5 4 1 5 5 4 1 0] [0 0 0 0 0 0 0 0 0]] P Matrix [[37 34 28 18 14 11 5 -1 0] [35 36 29 18 13 13 6 -1 0] [29 30 31 19 13 8 8 -1 0] [19 19 20 21 14 9 3 -1 0] [17 18 15 16 16 10 4 -1 0] [15 13 14 15 15 11 5 -1 0] [12 13 10 11 12 13 6 -1 0] [ 6 7 8 5 6 7 8 -1 0] [ 0 0 0 0 0 0 0 0 0]] E Matrix [[1 1 2 3 1 1 2 3 0] [5 1 1 2 3 1 1 2 0] [5 5 4 1 2 3 3 1 0] [1 1 5 4 1 2 3 3 0] [1 1 1 4 1 1 1 3 0] [1 1 5 4 1 1 2 3 0] [5 1 1 5 5 1 1 2 0] [5 5 4 1 5 5 4 1 0] [0 0 0 0 0 0 0 0 0]]